import React from 'react';
class App extends React.Component {
  add = () => {
    // this.props.count123 = 666
    this.props.onAdd(3)
  }
  render() {
    // props中的数据是只读的
    console.log(this.props)
    return <div className=''>
      子组件
      <h1>{this.props.count123}</h1>
      <button onClick={this.add}>+</button>
    </div>;
  }
}
export default App